import {asyncPost,asyncGet} from '../utils/request'
import store from '../store/index'
import {Message } from 'element-ui'

//菜单权限列表
export const getNodeList = () => asyncGet('/admin/user/nodeList')

//添加菜单
export const nodeRuleAdd = (params) => asyncPost('/admin/user/nodeAdd',params)

//删除菜单节点
export const nodeRuleDel = (params) => asyncPost('/admin/user/nodeDel',params)

//角色列表
export const getRoleList = (params) => asyncGet('/admin/user/roleList',params)

//新增角色
export const roleAdd = (params) => asyncPost('/admin/user/roleAdd',params)

//编辑角色
export const roleEdit = (params) => asyncPost('/admin/user/roleEdit',params)

//删除角色
export const roleDel = (params) => asyncPost('/admin/user/roleDel',params)

//获取授权权限
export const nodeAllList = () => asyncGet('/admin/common/nodeAll')

//授权提交
export const authForUser = (params) => asyncPost('/admin/user/roleNode',params)

//管理人员列表
export const getAdminList = (params) => asyncGet('/admin/user/userList',params)

//获取所有的角色下拉选择
export const getRoleAllList = (params) => asyncGet('/admin/common/roleAll',params)

//添加管理人员
export const adminAdd = (params) => asyncPost('/admin/user/userAdd',params)
//编辑管理人员
export const adminEdit = (params) => asyncPost('/admin/user/userEdit',params)
//编辑管理人员
export const adminDel = (params) => asyncPost('/admin/user/userDel',params)